﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Cuota003Chart.ascx.cs"
 Inherits="UILGestion.ObraAdmin.Chart.Cuota003Chart" %>

<%@ Register Assembly="WebLib" Namespace="WebLib" TagPrefix="lib" %>
<input id="idObra" type="hidden" runat="server" />


<asp:UpdatePanel ID="cuotaUPNL" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<script type="text/javascript">
<!--

    function mostrardetalles(num, ver) {
        var btnmostrar = document.getElementById("mostrar");
        var btnocultar = document.getElementById("ocultar");
        dis = ver ? '' : 'none';
        tab = document.getElementById('chart003');
        tab.getElementsByTagName('tr')[num].style.display = dis;
        btnmostrar.style.visibility = 'hidden';
        btnmostrar.style.display = 'none';
        btnocultar.style.visibility = 'visible';
        btnocultar.style.display = '';
    }
    function ocultardetalles(num, ver) {
        var btnmostrar = document.getElementById("mostrar");
        var btnocultar = document.getElementById("ocultar");
        dis = ver ? '' : 'none';
        tab = document.getElementById('chart003');
        tab.getElementsByTagName('tr')[num].style.display = dis;
        btnmostrar.style.visibility = 'visible';
        btnmostrar.style.display = '';
        btnocultar.style.visibility = 'hidden';
        btnocultar.style.display = 'none';

    }

    
-->
</script>



<table class="ui-accordion" id="chart003">
<tr>
<td>PERIODO: </td> 
    <td>
    <asp:DropDownList ID="periodoDDL" runat="server" Width="150px" AutoPostBack="true" 
            onselectedindexchanged="periodoDDL_SelectedIndexChanged">
    <asp:ListItem Text="2012" Value="2012"  />
    <asp:ListItem Text="2013" Value="2013"  />
    <asp:ListItem Text="2014" Value="2014"  />
    <asp:ListItem Text="2015" Value="2015"  />
    </asp:DropDownList>
    </td>
</tr>
    <tr>
        <td colspan="2">
        <asp:UpdatePanel runat="server"  ID="chardUPNL" UpdateMode="Conditional">
        <ContentTemplate>
       
         <asp:CHART id="Chart1" runat="server" Palette="BrightPastel" BackColor="#F3DFC1" Width="612px" Height="296px" BorderlineDashStyle="Solid" BackGradientStyle="TopBottom" ToolTip="Compras Realizadas: Orden de Compra Facturas (segun fecha de Emisión)"  BorderWidth="2" BorderColor="181, 64, 1">
                            <titles>
                                <asp:Title ShadowColor="32, 0, 0, 0" Font="Trebuchet MS, 11.25pt, style=Bold" ShadowOffset="3" Text="Proyeccion de Compras Vs. Compras Realizadas (s/.)" Name="Title1" ForeColor="80,66,20" Alignment=TopLeft></asp:Title>
                            </titles>
                           <legends>
                                 <asp:legend LegendStyle="Row" IsTextAutoFit="False" DockedToChartArea="ChartArea1" Docking="Bottom" IsDockedInsideChartArea="False" Name="Default" BackColor="Transparent" Font="Trebuchet MS, 8.25pt, style=Bold" Alignment="Center"></asp:legend>
                             </legends>

                            <borderskin SkinStyle="Emboss"></borderskin>
                            <series>
                                <asp:Series XValueType="DateTime" Name="Proyectado" BorderColor="180, 137, 13" Color="180,137,13" >    
                                    <points>
                                    <%--Proyectado--%>
                                        <asp:DataPoint XValue="36890" YValues="0" />
                                        <asp:DataPoint XValue="36891" YValues="0" />
                                        <asp:DataPoint XValue="36892" YValues="0" />
                                        <asp:DataPoint XValue="36893" YValues="0" />
                                        <asp:DataPoint XValue="36894" YValues="0" />
                                        <asp:DataPoint XValue="36895" YValues="0" />
                                        <asp:DataPoint XValue="36896" YValues="0" />
                                        <asp:DataPoint XValue="36897" YValues="0" />
                                        <asp:DataPoint XValue="36898" YValues="0" />
                                        <asp:DataPoint XValue="36899" YValues="0" />
                                        <asp:DataPoint XValue="36900" YValues="0" />
                                        <asp:DataPoint XValue="36901" YValues="0" />
                                    </points>
                                </asp:Series>
                                <asp:Series XValueType="DateTime" Name="Compras" BorderColor="92,167,222" Color="92,167,222"> 
                                    <points>
                                    <%--Compras--%>
                                        <asp:DataPoint XValue="36890" YValues="0" />
                                        <asp:DataPoint XValue="36891" YValues="0" />
                                        <asp:DataPoint XValue="36892" YValues="0" />
                                        <asp:DataPoint XValue="36893" YValues="0" />
                                        <asp:DataPoint XValue="36894" YValues="0" />
                                        <asp:DataPoint XValue="36895" YValues="0" />
                                        <asp:DataPoint XValue="36896" YValues="0" />
                                        <asp:DataPoint XValue="36897" YValues="0" />
                                        <asp:DataPoint XValue="36898" YValues="0" />
                                        <asp:DataPoint XValue="36899" YValues="0" />
                                        <asp:DataPoint XValue="36900" YValues="0" />
                                        <asp:DataPoint XValue="36901" YValues="0" />
                                    </points>
                                </asp:Series>
                              </series>
                            <chartareas>
                                <asp:ChartArea Name="ChartArea1" BorderColor="64, 64, 64, 64" BackSecondaryColor="White" BackColor="OldLace" ShadowColor="Transparent" BackGradientStyle="TopBottom">
                                    <area3dstyle Rotation="10" Perspective="10" Inclination="15" IsRightAngleAxes="False" WallWidth="0" IsClustered="False" />
                                    <axisy LineColor="64, 64, 64, 64"  LabelAutoFitMaxFontSize="8">
                                        <LabelStyle Font="Trebuchet MS, 7.25pt, style=Bold" Format="S/.0" />
                                        <MajorGrid LineColor="64, 64, 64, 64" />
                                    </axisy>


                                    <axisx LineColor="64, 64, 64, 64" IsLabelAutoFit="False" Interval="1">
                                        <LabelStyle Font="Trebuchet MS, 8.25pt" Interval="1" IntervalOffset="Auto" IntervalOffsetType="Auto" IntervalType="Auto" />
                                        <MajorGrid LineColor="64, 64, 64, 64" Interval="1" IntervalOffset="Auto" IntervalOffsetType="Auto" IntervalType="Auto" />
                                        <CustomLabels>
                                            <asp:CustomLabel FromPosition="36889.2" Text="Ene" ToPosition="36890.5" />
                                            <asp:CustomLabel FromPosition="36890.3" Text="Feb" ToPosition="36891.5" />
                                            <asp:CustomLabel FromPosition="36891.3" Text="Mar" ToPosition="36892.5" />
                                            <asp:CustomLabel FromPosition="36892.3" Text="Abr" ToPosition="36893.5" />
                                            <asp:CustomLabel FromPosition="36893.2" Text="May" ToPosition="36894.5" />
                                            <asp:CustomLabel FromPosition="36894.3" Text="Jun" ToPosition="36895.5" />
                                            <asp:CustomLabel FromPosition="36895.3" Text="Jul" ToPosition="36896.5" />
                                            <asp:CustomLabel FromPosition="36896.3" Text="Ago" ToPosition="36897.5" />
                                            <asp:CustomLabel FromPosition="36897.3" Text="Set" ToPosition="36898.5" />
                                            <asp:CustomLabel FromPosition="36898.3" Text="Oct" ToPosition="36899.5" />
                                            <asp:CustomLabel FromPosition="36899.3" Text="Nov" ToPosition="36900.5" />
                                            <asp:CustomLabel FromPosition="36899.6" Text="Dic" ToPosition="36902.5" />

                                        </CustomLabels>
                                        <MajorTickMark Interval="1" IntervalOffset="Auto" IntervalOffsetType="Auto" IntervalType="Auto" />
                                    </axisx>

                                </asp:ChartArea>
                            </chartareas>
                        </asp:CHART>
 

        </ContentTemplate>
        <Triggers>
        <asp:AsyncPostBackTrigger ControlID="periodoDDL" />
        </Triggers>
        </asp:UpdatePanel>
 
         </td>
    </tr>
    <tr>
        <td colspan="2">
        <asp:UpdatePanel runat="server"  ID="gridUPNL" UpdateMode="Conditional">
        <ContentTemplate>
            <asp:GridView ID="itemGridView" runat="server" AutoGenerateColumns="False" 
                CellPadding="4" DataKeyNames="mes" onrowcancelingedit="CancelItem" 
                 onrowediting="EditItem" 
                OnRowUpdating="UpdateItem" ShowFooter="false" 
                ShowHeader="true" 
                ShowHeaderWhenEmpty="true" SkinID="GridView">
                <Columns>
                    <asp:TemplateField HeaderText="Año" ItemStyle-Width="50px">
                        <ItemTemplate>
                            <asp:Label ID="aniolbl" runat="server" Text='<%# Eval("anio")%>'></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                        <asp:Label ID="aniolbl" runat="server" Text='<%# Eval("anio")%>'></asp:Label>
                            
                        </EditItemTemplate>
                        <FooterTemplate>
                            <asp:TextBox ID="anioTxt0" runat="server" Width="100%" />
                        </FooterTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Mes" ItemStyle-Width="50px">
                        <ItemTemplate>
                            <asp:Label ID="meslbl" runat="server" Text='<%# Eval("mes")%>'></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                        <asp:Label ID="meslbl" runat="server" Text='<%# Eval("mes")%>'></asp:Label>
                            
                        </EditItemTemplate>
                        <FooterTemplate>
                            <asp:TextBox ID="mesTxt" runat="server" Width="100%" />
                        </FooterTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Proyectado" ItemStyle-Width="150px" ItemStyle-HorizontalAlign="Right">
                        <ItemTemplate>
                            <asp:Label ID="totallbl" runat="server" Text='<%# Eval("totalProyectadoStr")%>'></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                        
                            <lib:Input ID="totalTxt" runat="server" Text='<%# Eval("totalProyectado")%>'  DataType="Double"
                                Width="100%" />
                        </EditItemTemplate>
                        <FooterTemplate>
                            <asp:TextBox ID="totalTxt0" runat="server" Width="100%" />
                        </FooterTemplate>
                    </asp:TemplateField>
                    <asp:CommandField ButtonType="Image" CancelImageUrl="~/Images/cancel.gif" 
                        EditImageUrl="~/Images/edit.gif" ShowEditButton="true" 
                        UpdateImageUrl="~/Images/update.gif" />
                 

                    <asp:TemplateField HeaderText="Compras" ItemStyle-Width="120px" ItemStyle-HorizontalAlign="Right">
                        <ItemTemplate>
                            <asp:Label ID="compraslbl" runat="server" Text='<%# Eval("ComprasStr")%>'></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                        <asp:Label ID="compraslbl" runat="server" Text='<%# Eval("ComprasStr")%>'></asp:Label>
                            
                        </EditItemTemplate>
                        <FooterTemplate>
                            <asp:TextBox ID="mesTxt" runat="server" Width="100%" />
                        </FooterTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
        </ContentTemplate>
        <Triggers>
        <asp:AsyncPostBackTrigger ControlID="periodoDDL" />
        </Triggers>
        </asp:UpdatePanel>
        </td>
    </tr>
   <tr>
   <td align=left>
    <input type="button" id="mostrar" value="Configurar" onclick="mostrardetalles(1,true)"  />
        <input type="button" id="ocultar" value="Ocultar Configuración" onclick="ocultardetalles(1, false)" />
        </td>
   </tr>
</table>

</ContentTemplate>

</asp:UpdatePanel>